package A2018;

public class _4_方格计数 {
	static int N=1000;
	private static int ans;
	public static void main(String[] args) {
		for (int i = 1; i < N; i++) {
			for (int j = 1; j < N; j++) {
				if(i*i+j*j<=N*N) ans++;
			}
		}
		System.out.println(ans*4);
	}

}
